#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	string truncateSentence(string s, int k) {
		int n = -1;
		while (k--) n = s.find(' ', n + 1);
		if (n != -1) s.erase(begin(s) + n, end(s));
		return s;
	}

private:
};

int main()
{
	Solution solution;
	return 0;
}
